import { lazy ,Suspense} from "react";
import { Navigate } from "react-router-dom";
import Loading from "../component/Loading/Loading"

let NotFound = lazy(() => import("../view/NotFound/NotFound"))
let StatSurvey = lazy(() => import("../view/Index/XFC/StatSurvey"))
let StatService = lazy(() => import("../view/Index/XFC/StatService"))
let StatHealth = lazy(() => import("../view/Index/XFC/StatHealth"))
let StatTag = lazy(() => import("../view/Index/XFC/StatTag"))
let StatAge = lazy(() => import("../view/Index/XFC/StatAge"))
let StatSign = lazy(() => import("../view/Index/XFC/StatSign"))
let StatEducation = lazy(() => import("../view/Index/XFC/StatEducation"))
let StatGender = lazy(() => import("../view/Index/XFC/StatGender"))


 // 数据统计

let Statistics: any = [
    //数据概况
    {
        path: '/index/statistics-survey',
        element:<Suspense fallback={<Loading/>}><StatSurvey/></Suspense>
    },
    // 签约业绩统计
    {
        path: '/index/statistics-sign',
        element:<Suspense fallback={<Loading/>}><StatSign/></Suspense>
    },
    // 服务业绩统计
    {
        path: '/index/statistics-service',
        element:<Suspense fallback={<Loading/>}><StatService/></Suspense>
    },
    // 居民健康异常统计
    {
        path: '/index/statistics-health',
        element:<Suspense fallback={<Loading/>}><StatHealth/></Suspense>
    },
    // 居民标签统计
    {
        path: '/index/statistics-tag',
        element:<Suspense fallback={<Loading/>}><StatTag/></Suspense>
    },
    // 居民年龄统计
    {
        path: '/index/statistics-age',
        element:<Suspense fallback={<Loading/>}><StatAge/></Suspense>
    },
    //居民学历统计
    {
        path: '/index/statistics-education',
        element:<Suspense fallback={<Loading/>}><StatEducation/></Suspense>
    },
    //居民性别统计
    {
        path: '/index/statistics-gender',
        element: <Suspense fallback={<Loading/>}><StatGender /></Suspense>
    },
    
    {
        path: "*",
        element: <Suspense fallback={<Loading/>}><NotFound /></Suspense>//404
    },
    {
        path: "index/statistics-survey",
        element: <Navigate to="/index/statistics-survey" />//重定项
    }
]
export default Statistics